package com.summer.data.dialect.postgre;

import com.summer.data.dialect.Dialect;
import com.summer.data.dialect.DialectCenter;
import com.summer.data.dialect.DialectRouter;

/**
 * @author 345480567@qq.com
 */

public class PostgreSqlDialectRouter implements DialectRouter {

    public static final String PROD_NAME = "POSTGRESQL";

    private static final DialectRouter ROUTER_INSTANCE = new PostgreSqlDialectRouter();

    private static final Dialect DIALECT_INSTANCE = new PostgreSqlDialect();

    @Override
    public String getName() {
        return PROD_NAME;
    }

    @Override
    public int score() {
        return 0;
    }

    @Override
    public Dialect route(int version) {
        return DIALECT_INSTANCE;
    }

    static  {
        System.out.println("sql dialect 注册 : " + PROD_NAME);
        DialectCenter.regDialect(PROD_NAME, ROUTER_INSTANCE);
    }

}
